.class public Les/g10;
.super Lcom/estrongs/dlna/core/c;
.source "DlnaControllerManager.java"


# static fields
.field private static f:Les/g10;


# instance fields
.field private a:Les/k10;

.field private b:Landroid/os/HandlerThread;

.field private c:Landroid/os/Handler;

.field private d:Landroid/os/Handler;

.field private e:Les/l10;


# direct methods
.method private constructor <init>()V
    .locals 2

    .line 1
    invoke-direct {p0}, Lcom/estrongs/dlna/core/c;-><init>()V

    .line 2
    new-instance v0, Landroid/os/HandlerThread;

    const-string v1, "dlnaRefreshState"

    invoke-direct {v0, v1}, Landroid/os/HandlerThread;-><init>(Ljava/lang/String;)V

    iput-object v0, p0, Les/g10;->b:Landroid/os/HandlerThread;

    .line 3
    invoke-virtual {v0}, Landroid/os/HandlerThread;->start()V

    .line 4
    new-instance v0, Landroid/os/Handler;

    iget-object v1, p0, Les/g10;->b:Landroid/os/HandlerThread;

    invoke-virtual {v1}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    iput-object v0, p0, Les/g10;->c:Landroid/os/Handler;

    .line 5
    new-instance v0, Landroid/os/Handler;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    iput-object v0, p0, Les/g10;->d:Landroid/os/Handler;

    return-void
.end method

.method static synthetic a(Les/g10;)Les/k10;
    .locals 0

    .line 1
    iget-object p0, p0, Les/g10;->a:Les/k10;

    return-object p0
.end method

.method static synthetic a(Les/g10;Les/k10;)Les/k10;
    .locals 0

    .line 2
    iput-object p1, p0, Les/g10;->a:Les/k10;

    return-object p1
.end method

.method static synthetic a(Les/g10;Les/h10;)V
    .locals 0

    .line 3
    invoke-direct {p0, p1}, Les/g10;->a(Les/h10;)V

    return-void
.end method

.method static synthetic a(Les/g10;Les/l10;Lorg/teleal/cling/support/model/TransportState;)V
    .locals 0

    .line 4
    invoke-direct {p0, p1, p2}, Les/g10;->a(Les/l10;Lorg/teleal/cling/support/model/TransportState;)V

    return-void
.end method

.method private a(Les/h10;)V
    .locals 2

    if-nez p1, :cond_0

    return-void

    .line 44
    :cond_0
    iget-object v0, p0, Les/g10;->d:Landroid/os/Handler;

    new-instance v1, Les/g10$g;

    invoke-direct {v1, p0, p1}, Les/g10$g;-><init>(Les/g10;Les/h10;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method private a(Les/l10;Lorg/teleal/cling/support/model/TransportState;)V
    .locals 1

    .line 41
    invoke-virtual {p1}, Les/l10;->f()Lorg/teleal/cling/support/model/TransportState;

    move-result-object v0

    if-eq v0, p2, :cond_0

    .line 42
    invoke-virtual {p1, p2}, Les/l10;->a(Lorg/teleal/cling/support/model/TransportState;)V

    .line 43
    invoke-static {}, Lcom/estrongs/dlna/core/b;->g()Lcom/estrongs/dlna/core/b;

    move-result-object p2

    invoke-virtual {p2, p1}, Lcom/estrongs/dlna/core/b;->a(Les/l10;)V

    :cond_0
    return-void
.end method

.method static synthetic b(Les/g10;)Landroid/os/Handler;
    .locals 0

    .line 1
    iget-object p0, p0, Les/g10;->c:Landroid/os/Handler;

    return-object p0
.end method

.method static synthetic b(Les/g10;Les/h10;)V
    .locals 0

    .line 2
    invoke-direct {p0, p1}, Les/g10;->b(Les/h10;)V

    return-void
.end method

.method private b(Les/h10;)V
    .locals 2

    if-nez p1, :cond_0

    return-void

    .line 11
    :cond_0
    iget-object v0, p0, Les/g10;->d:Landroid/os/Handler;

    new-instance v1, Les/g10$f;

    invoke-direct {v1, p0, p1}, Les/g10$f;-><init>(Les/g10;Les/h10;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method public static e()Les/g10;
    .locals 2

    .line 1
    sget-object v0, Les/g10;->f:Les/g10;

    if-nez v0, :cond_1

    .line 2
    const-class v0, Les/g10;

    monitor-enter v0

    .line 3
    :try_start_0
    sget-object v1, Les/g10;->f:Les/g10;

    if-nez v1, :cond_0

    .line 4
    new-instance v1, Les/g10;

    invoke-direct {v1}, Les/g10;-><init>()V

    sput-object v1, Les/g10;->f:Les/g10;

    .line 5
    :cond_0
    monitor-exit v0

    goto :goto_0

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1

    .line 6
    :cond_1
    :goto_0
    sget-object v0, Les/g10;->f:Les/g10;

    return-object v0
.end method


# virtual methods
.method public a(Ljava/lang/String;)Ljava/lang/String;
    .locals 3

    .line 9
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "/"

    .line 10
    invoke-virtual {p1, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 11
    invoke-static {}, Lcom/estrongs/dlna/core/b;->g()Lcom/estrongs/dlna/core/b;

    move-result-object v1

    invoke-virtual {v1}, Lcom/estrongs/dlna/core/b;->d()Ljava/lang/String;

    move-result-object v1

    .line 12
    iget-object v2, p0, Les/g10;->a:Les/k10;

    if-eqz v2, :cond_0

    .line 13
    invoke-interface {v2, v1, p1}, Les/k10;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    goto :goto_0

    :cond_0
    const-string v2, "http://"

    .line 14
    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v1, ":"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const/16 v1, 0x1fff

    .line 15
    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    goto :goto_0

    .line 16
    :cond_1
    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 17
    :goto_0
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-static {p1}, Les/n10;->c(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    return-object p1
.end method

.method public a()V
    .locals 0

    .line 8
    invoke-virtual {p0}, Les/g10;->d()V

    return-void
.end method

.method public a(Landroid/content/Context;)V
    .locals 1

    .line 5
    invoke-static {}, Lcom/estrongs/dlna/core/b;->g()Lcom/estrongs/dlna/core/b;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/estrongs/dlna/core/b;->a(Landroid/content/Context;)V

    .line 6
    invoke-static {}, Lcom/estrongs/dlna/core/b;->g()Lcom/estrongs/dlna/core/b;

    move-result-object p1

    invoke-virtual {p1, p0}, Lcom/estrongs/dlna/core/b;->a(Lcom/estrongs/dlna/core/c;)V

    .line 7
    invoke-static {}, Lcom/estrongs/dlna/core/b;->g()Lcom/estrongs/dlna/core/b;

    move-result-object p1

    invoke-virtual {p1}, Lcom/estrongs/dlna/core/b;->f()V

    return-void
.end method

.method public a(Les/k10;)V
    .locals 0

    .line 45
    iput-object p1, p0, Les/g10;->a:Les/k10;

    return-void
.end method

.method public a(Les/l10;)Z
    .locals 4

    const/4 v0, 0x0

    if-nez p1, :cond_0

    return v0

    .line 37
    :cond_0
    invoke-virtual {p1}, Les/l10;->e()Lorg/teleal/cling/model/meta/RemoteDevice;

    move-result-object v1

    new-instance v2, Lorg/teleal/cling/model/types/UDAServiceType;

    const-string v3, "AVTransport"

    invoke-direct {v2, v3}, Lorg/teleal/cling/model/types/UDAServiceType;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, v2}, Lorg/teleal/cling/model/meta/Device;->findService(Lorg/teleal/cling/model/types/ServiceType;)Lorg/teleal/cling/model/meta/Service;

    move-result-object v1

    if-nez v1, :cond_1

    const-string p1, "avTransportService is null, this device not support!"

    .line 38
    invoke-static {p1}, Les/m10;->b(Ljava/lang/String;)V

    return v0

    .line 39
    :cond_1
    new-instance v0, Les/g10$e;

    invoke-direct {v0, p0, v1, p1}, Les/g10$e;-><init>(Les/g10;Lorg/teleal/cling/model/meta/Service;Les/l10;)V

    .line 40
    invoke-static {}, Lcom/estrongs/dlna/core/b;->g()Lcom/estrongs/dlna/core/b;

    move-result-object p1

    invoke-virtual {p1, v0}, Lcom/estrongs/dlna/core/b;->a(Lorg/teleal/cling/controlpoint/ActionCallback;)V

    const/4 p1, 0x1

    return p1
.end method

.method public a(Les/l10;Les/h10;)Z
    .locals 4

    const/4 v0, 0x0

    if-nez p1, :cond_0

    .line 30
    invoke-direct {p0, p2}, Les/g10;->a(Les/h10;)V

    return v0

    .line 31
    :cond_0
    invoke-virtual {p1}, Les/l10;->e()Lorg/teleal/cling/model/meta/RemoteDevice;

    move-result-object v1

    new-instance v2, Lorg/teleal/cling/model/types/UDAServiceType;

    const-string v3, "AVTransport"

    invoke-direct {v2, v3}, Lorg/teleal/cling/model/types/UDAServiceType;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, v2}, Lorg/teleal/cling/model/meta/Device;->findService(Lorg/teleal/cling/model/types/ServiceType;)Lorg/teleal/cling/model/meta/Service;

    move-result-object v1

    if-eqz v1, :cond_2

    .line 32
    iget-object v2, p0, Les/g10;->a:Les/k10;

    if-nez v2, :cond_1

    goto :goto_0

    .line 33
    :cond_1
    new-instance v0, Les/g10$c;

    invoke-direct {v0, p0, v1, p1, p2}, Les/g10$c;-><init>(Les/g10;Lorg/teleal/cling/model/meta/Service;Les/l10;Les/h10;)V

    .line 34
    invoke-static {}, Lcom/estrongs/dlna/core/b;->g()Lcom/estrongs/dlna/core/b;

    move-result-object p1

    invoke-virtual {p1, v0}, Lcom/estrongs/dlna/core/b;->a(Lorg/teleal/cling/controlpoint/ActionCallback;)V

    const/4 p1, 0x1

    return p1

    :cond_2
    :goto_0
    const-string p1, "avTransportService is null, this device not support!"

    .line 35
    invoke-static {p1}, Les/m10;->b(Ljava/lang/String;)V

    .line 36
    invoke-direct {p0, p2}, Les/g10;->a(Les/h10;)V

    return v0
.end method

.method public a(Les/l10;Ljava/lang/String;Les/h10;)Z
    .locals 11

    .line 18
    invoke-virtual {p0, p1}, Les/g10;->b(Les/l10;)V

    const/4 v0, 0x0

    if-nez p1, :cond_0

    .line 19
    invoke-direct {p0, p3}, Les/g10;->a(Les/h10;)V

    return v0

    .line 20
    :cond_0
    invoke-virtual {p1, p2}, Les/l10;->a(Ljava/lang/String;)V

    .line 21
    invoke-virtual {p1}, Les/l10;->e()Lorg/teleal/cling/model/meta/RemoteDevice;

    move-result-object v1

    new-instance v2, Lorg/teleal/cling/model/types/UDAServiceType;

    const-string v3, "AVTransport"

    invoke-direct {v2, v3}, Lorg/teleal/cling/model/types/UDAServiceType;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, v2}, Lorg/teleal/cling/model/meta/Device;->findService(Lorg/teleal/cling/model/types/ServiceType;)Lorg/teleal/cling/model/meta/Service;

    move-result-object v6

    if-eqz v6, :cond_2

    .line 22
    iget-object v1, p0, Les/g10;->a:Les/k10;

    if-nez v1, :cond_1

    goto :goto_0

    .line 23
    :cond_1
    invoke-static {}, Les/g10;->e()Les/g10;

    move-result-object v0

    invoke-virtual {v0, p2}, Les/g10;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    .line 24
    invoke-static {}, Les/n10;->d()Lorg/teleal/cling/model/types/UDN;

    move-result-object p2

    invoke-virtual {p2}, Lorg/teleal/cling/model/types/UDN;->getIdentifierString()Ljava/lang/String;

    move-result-object p2

    const/4 v0, 0x1

    .line 25
    invoke-static {v0, p2}, Les/n10;->a(ILjava/lang/String;)Ljava/lang/String;

    move-result-object v8

    .line 26
    new-instance p2, Les/g10$b;

    move-object v4, p2

    move-object v5, p0

    move-object v9, p1

    move-object v10, p3

    invoke-direct/range {v4 .. v10}, Les/g10$b;-><init>(Les/g10;Lorg/teleal/cling/model/meta/Service;Ljava/lang/String;Ljava/lang/String;Les/l10;Les/h10;)V

    .line 27
    invoke-static {}, Lcom/estrongs/dlna/core/b;->g()Lcom/estrongs/dlna/core/b;

    move-result-object p1

    invoke-virtual {p1, p2}, Lcom/estrongs/dlna/core/b;->a(Lorg/teleal/cling/controlpoint/ActionCallback;)V

    return v0

    :cond_2
    :goto_0
    const-string p1, "avTransportService is null, this device not support!"

    .line 28
    invoke-static {p1}, Les/m10;->b(Ljava/lang/String;)V

    .line 29
    invoke-direct {p0, p3}, Les/g10;->a(Les/h10;)V

    return v0
.end method

.method public b()V
    .locals 0

    return-void
.end method

.method public b(Les/l10;)V
    .locals 0

    .line 12
    iput-object p1, p0, Les/g10;->e:Les/l10;

    return-void
.end method

.method public b(Les/l10;Les/h10;)Z
    .locals 3

    const/4 v0, 0x0

    if-nez p1, :cond_0

    .line 3
    invoke-direct {p0, p2}, Les/g10;->a(Les/h10;)V

    return v0

    .line 4
    :cond_0
    iget-object v1, p0, Les/g10;->c:Landroid/os/Handler;

    invoke-virtual {p1}, Les/l10;->d()Ljava/lang/Runnable;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    .line 5
    sget-object v1, Lorg/teleal/cling/support/model/TransportState;->STOPPED:Lorg/teleal/cling/support/model/TransportState;

    invoke-direct {p0, p1, v1}, Les/g10;->a(Les/l10;Lorg/teleal/cling/support/model/TransportState;)V

    .line 6
    invoke-virtual {p1}, Les/l10;->e()Lorg/teleal/cling/model/meta/RemoteDevice;

    move-result-object p1

    new-instance v1, Lorg/teleal/cling/model/types/UDAServiceType;

    const-string v2, "AVTransport"

    invoke-direct {v1, v2}, Lorg/teleal/cling/model/types/UDAServiceType;-><init>(Ljava/lang/String;)V

    invoke-virtual {p1, v1}, Lorg/teleal/cling/model/meta/Device;->findService(Lorg/teleal/cling/model/types/ServiceType;)Lorg/teleal/cling/model/meta/Service;

    move-result-object p1

    if-nez p1, :cond_1

    const-string p1, "avTransportService is null, this device not support!"

    .line 7
    invoke-static {p1}, Les/m10;->b(Ljava/lang/String;)V

    .line 8
    invoke-direct {p0, p2}, Les/g10;->a(Les/h10;)V

    return v0

    .line 9
    :cond_1
    new-instance v0, Les/g10$d;

    invoke-direct {v0, p0, p1, p2}, Les/g10$d;-><init>(Les/g10;Lorg/teleal/cling/model/meta/Service;Les/h10;)V

    .line 10
    invoke-static {}, Lcom/estrongs/dlna/core/b;->g()Lcom/estrongs/dlna/core/b;

    move-result-object p1

    invoke-virtual {p1, v0}, Lcom/estrongs/dlna/core/b;->a(Lorg/teleal/cling/controlpoint/ActionCallback;)V

    const/4 p1, 0x1

    return p1
.end method

.method public c()Les/l10;
    .locals 1

    .line 1
    iget-object v0, p0, Les/g10;->e:Les/l10;

    return-object v0
.end method

.method public d()V
    .locals 2

    .line 1
    iget-object v0, p0, Les/g10;->c:Landroid/os/Handler;

    new-instance v1, Les/g10$a;

    invoke-direct {v1, p0}, Les/g10$a;-><init>(Les/g10;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method
